<{:W('Bizhome/header',array($biz_item_num,$user))}>
    <div class="right_box">
		<div class="content">
			<div class="head_box">
				<h2>球馆列表</h2>
			</div>
			
			<div class="info_table">
				<table>
					<tbody>
						<tr>
							<th>球馆名称</th>
							<th>球馆地址</th>
							<th>球馆电话</th>
							<th>球馆场地数</th>
							<th>营业时间</th>
							<th>功能</th>
						</tr>
					<foreach name="data" item="vo" key="k">
						<!-- <input type="hidden" name="gymnasium_id" value="<{$vo.gymnasium_id}>" /> -->
                        <tr class="alt">
                         	<td><{$vo.gymnasium_name}><input type="hidden" class="gymnasium_id" value="<{$vo.gymnasium_id}>"></input></td>
                         	                     
                         	<td class="detail">
                         		<{$vo.gymnasium_location_bref}>
                         		
                         	</td>
                         	<td class="detail"><{$vo.gymnasium_phone_number}></td>
                         	<td class="detail">
                         		<{$vo.court_number}>
                         	</td>
							<td class="detail">
                         		<{$vo.gymnasium_open_time}><span>:00~<span><{$vo.gymnasium_close_time}><span>:00<span>
                         	</td>
                         	<td>
							    <button onclick="gym_detail(<{$k}>)">详情</button>
                         		<button onclick="edit_gym(<{$k}>)">修改</button>
								<!-- <button onclick="close_gym(<{$k}>)">停馆</button> -->
								<button onclick="publish_announce(<{$k}>)">发布公告</button>
                         		<button onclick="publish_activity(<{$k}>)">发布活动</button>
                         	</td>
                        </tr> 
                    </foreach>					              
					</tbody>
				</table>
				
			</div>	
			
			<div class="blank"></div>		
		</div>
	</div>	


<div class="blank20"></div>
<script>
   var select_gym_set = document.getElementsByClassName("gymnasium_id");
    function gym_detail(num)
	{
	 selected=select_gym_set[num].value;
	  
	  layer.open({
                 type: 2,
                 title: '球馆详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['400px' , '300px'],
                 content: 'gym_detail.html'
				 });
	}
	function close_gym(num)
	{
	  layer.confirm('确定闭馆？', {
       btn: ['确定','取消'] //按钮
       }, function(){      
       $.post('__URL__/closeGymnasium',{'court_id':selected_court,'court_gymnasium_id':selected_gym},function(resultList){ 			   
			  msg=resultList.msg;
			  if (msg!=0) {
			    layer.msg('球场已闭馆，无需重复操作');
			  }
			  else 
			  {
			    layer.msg('闭馆成功');
			  }
    	     },'json');  
    }, function(){
      
    });
	}
	function edit_gym(num)
	{
	   selected=select_gym_set[num].value;
	   layer.open({
                 type: 2,
                 title: '球馆详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['800px' , '650px'],
                 content: 'edit_gym.html'
				 });
	}
	function publish_announce(num)
	{
	  selected=select_gym_set[num].value;
	  layer.open({
                 type: 2,
                 title: '球馆详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['800px' , '650px'],
                 content: 'gymnasium_announce_create.html'
				 });
	}
	function publish_activity(num)
	{
	  selected=select_gym_set[num].value;
	  layer.open({
                 type: 2,
                 title: '球馆详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['800px' , '650px'],
                 content: 'add_gymnasium_activity.html'
				 });
	}
 </script>
<{:W('Bizhome/footer')}>


